import { useMemo } from 'react';

function useWebsocked(user_id = 10, server_id = 300) {
  const ws = useMemo(() => {
    return new WebSocket(`ws://115.190.7.15:8003/koa/ws?user_id=${user_id}&server_id=${server_id}`);
  }, [user_id, server_id]);

  return { ws };
}

export default useWebsocked;